package com.webex.ta.hydra.gui.action;

import com.webex.ta.hydra.gui.GuiPackage;
import com.webex.ta.hydra.gui.project.HydraProjectSuite;

import java.util.Set;
import java.util.HashSet;
import java.awt.event.ActionEvent;

/**
 * Author: Vegaz
 * Date: 2010-11-8
 * Time: 16:37:30
 */
public class NewAction implements ActionHandler {
    private static Set<String> commands = new HashSet<String>();

    static {
        commands.add(ActionNames.NEW);
    }

    public Set<String> getActionNames() {
        return commands;
    }

    public void doAction(ActionEvent e) {
        HydraProjectSuite project = new HydraProjectSuite();
        project.setName(HydraProjectSuite.ProjectNameSequencer.nextProjectName());
        GuiPackage.getInstance().getIdeFrame().addProject(project);
        project.takeSnapshot();
    }
}
